@extends('layout.layout')
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
<link rel="stylesheet" href="/style/dateTime.css">
  <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
  <script src="/style/dateTime.min.js"></script>
<h1>比赛管理-比赛添加</h1>
<form action='{{url("admin/matchCreate")}}' method="post">
@csrf
    <div class='div_basic div_form'>
      <div class="form-group">
        <label for="exampleInputEmail1">参赛球队1</label>
        
        <select class="form-control" name='team_one'>
          <option value='0'>--请选择--</option>
        @foreach($data as $k=>$v)
          <option value="{{$v->team_id}}">{{$v->team_name}}【{{$v->team_group}}】</option>
        @endforeach
        </select>
      </div>

      <div class="form-group">
        <label for="exampleInputEmail1">参赛球队2</label>
        
        <select class="form-control" name='team_two'>
          <option value='0'>--请选择--</option>
        @foreach($data as $k=>$v)
          <option value="{{$v->team_id}}">{{$v->team_name}}【{{$v->team_group}}】</option>
        @endforeach
        </select>
      </div>

      <div class="form-group">
        <label for="exampleInputEmail1">比赛时间</label>
        <input type="text" class="form-control"  placeholder="请选择日期和时间" name='start_time' id="datetime">
      </div>
    </div>  
    <button type="submit" class="btn btn-success" id='btn'>比赛添加</button>
  </form>
<script>
  $("#datetime").datetime({
    type:"datetime",
    value:[2019,7,15,15,30]
  })
</script>
  <script>
    window.onload=function(){
      var totleTp = 0;
      var tppiao = document.getElementsByClassName("tppiao");
      for(var i=0;i<tppiao.length;i++){totleTp+=parseInt(tppiao[i].innerHTML);}
      var tpdetial = document.getElementsByClassName("tpdetial");
      for(var i=0;i<tpdetial.length;i++){var mun = parseInt(tpdetial[i].getElementsByClassName("tppiao")[0].innerHTML);var bfb = (mun*100/totleTp).toFixed(2)+"%";tpdetial[i].getElementsByClassName("tppercent")[0].innerHTML = bfb;
      }
    }
    if(window.location.href.indexOf("udsid=")>-1){
      $("#ctlNext").on("click",function(){
        console.log("执行成功！")
        meteor.track("form", {convert_id: "1641358861914125"})
      })
    }
  </script>
</body>
</html>
